<!DOCTYPE html>
<#include "/ftl/header.ftl">
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
</head>
<#include "/ftl/menu.ftl">

<script type="text/javascript">
    function add(a) {
        window.location.href = "../attributeclass/add?categoryId="+a;
    }
    function del(a,b) {

        var r = window.confirm("确认删除？");
        if (r == true) {
            window.location.href = "../attributeclass/delete?attributeClassId="+a+"&categoryId="+b;
        }



    }
    function filtrate(id){
        window.location.href = "../category/filtratelist?categoryId="+id;
    }
    function edit(id) {

        window.location.href = "../attributeclass/edit?attributeClassId="+id;

    }
    function editdetail(id,categoryId) {

        window.location.href = "../attributeclass/editdetail?attributeClassId="+id+"&categoryId="+categoryId;

    }

</script>
<body>
<div class="container">




    <div class="row">
        <div class="col-md-12">
            <ol class="breadcrumb">
                <li>产品类别</li>
                <li>电气参数</li>
                <li class="active">${category.cname}</li>

            </ol>
        </div>
    </div>



    <div class="row">
        <div class="col-md-12">

            <div class="block">

                <div class="form-row">
                    <div class="col-md-10">
                       </div>
                    <div class="col-md-1">
                    <div><button class="btn btn-default btn-clean"
                                 type="button" onclick="filtrate(${category.categoryId})">筛选排序参数维护</button></div>
                </div>
                    <div class="col-md-1">

                        <div><button class="btn btn-default btn-clean"
                                     type="button" onclick="add(${category.categoryId})">添加</button></div>
                    </div>
                </div>
                <div class="content">
                    <table class="table table-bordered table-striped table-hover">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>属性分类名称</th>
                            <th>创建时间</th>
                            <th>使用状态</th>
                            <th>排序</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <#if list??>
                        <#list list as list>
                        <tr>
                            <input type="hidden" name="id1" value="${list.attributeClassId}" />
                            <input type="hidden" name="id2" value="${list.category.categoryId}" />
                            <td>${list_index+1}</td>

                            <td>${list.acName!}</td>

                            <td>${(list.createDate?string("YYYY-MM-dd"))!}</td>
                            <td> <#if list.status == 1>
                                正常
                                <#else>
                                禁用
                            </#if></td>
                            <td>${list.sort!}</td>
                            <td><button class="btn btn-default btn-clean"
                                        type="button" onclick="del(${list.attributeClassId},${category.categoryId})">删除</button>
                                <button class="btn btn-default btn-clean"
                                        type="button" onclick="edit(${list.attributeClassId})">修改</button>
                                <button class="btn btn-default btn-clean"
                                        type="button" onclick="editdetail(${list.attributeClassId},${list.category.categoryId})">参数明细</button>
                            </td>
                        </tr>

                        </#list>
                    </#if>
                    </tbody>

                    </table>

                </div>
            </div>

        </div>
    </div>
</div>

</body>
</html>